package com.itheima.d7_IO.FileOutputStream01;

import java.io.*;

public class Copy {
    public static void main(String[] args) throws Exception {
        try(
                InputStream fs = new FileInputStream("E:\\FileResource\\1.PNG");
                OutputStream  os = new FileOutputStream("E:\\FileResource\\Empty\\1.PNG");
                ) {
            // E:\FileResource\1.PNG  把这个文件拷贝倒E:\FileResource\Empty\1.PNG

            File file = new File("E:\\FileResource\\1.PNG");
            byte[] bytes = new byte[1024];
            int len ;
            // 输出流管道
            while ((len =fs.read(bytes))!= -1) {
                os.write(bytes,0,len);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
